<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>标题</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="/lib/layui/css/layui.css">
    <!-- 注意：如果你直接复制所有代码到本地，上述css路径需要改成你本地的 -->
</head>
<body>
<form class="layui-form searchForm">
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label" style="width: 100px;">名称：</label>
            <div class="layui-input-inline">
                <input type="text" name="name" id="name" autocomplete="off" class="layui-input">
            </div>
        </div>
    </div>
</form>
<table class="layui-hide" id="dataList" lay-filter="dataList"></table>

<script type="text/javascript" src="/lib/layui/layui.js"></script>
<script src="/static/js/main.js"></script>
<script>
    var configureCom = {};
    var table = {};
    layui.use(['jquery', 'configureCom', 'configure', 'sessionFun', 'table'], function () {
        var $ = layui.jquery;
        var configure = layui.configure;
        table = layui.table;
        var sessionFun = layui.sessionFun;
        configureCom = layui.configureCom;

        var cols = [[
            {type: 'checkbox'},
            {title: '序号', type: 'numbers'},
            {field: 'roleName', title: '角色名称'},
            {field: 'createTime', title: '添加时间'},
            {field: '', title: '角色人员数'},
            {
                field: '', title: '状态', templet: function (d) {
                    var text = '';
                    if (d.useStatus == 0) {
                        text = '<span style="color:green;">启用</span>'
                    } else {
                        text = '<span style="color:red;">禁用</span>'
                    }
                    return text;
                }
            },
            {fixed: 'right', title: '操作', toolbar: '#barDemo', width: 150}
        ]];
        configureCom.tableRender(configure.ROLE_LIST_HTTP, {}, cols, 'dataList', 10, 'full-100', 'toolbarOrg');
    });
    function getData(){
        return table.checkStatus('dataList').data;
    }

</script>
</body>
</html>